package com.haker.mensa2;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

public class start_Adapter extends BaseAdapter {
    private Context mContext;

    public start_Adapter(Context c) {
        mContext = c;
    }

    public int getCount() {
        return mText.length;
    }

    public Object getItem(int position) {
    	 return position;
    }

    public long getItemId(int position) {
    	 return position;
    }

    // create a new ImageView for each item referenced by the Adapter
    public View getView(int position, View convertView, ViewGroup parent) {
    	LinearLayout lay = (LinearLayout)View.inflate(mContext, R.layout.adapter, null);
    	ImageView image=(ImageView) lay.getChildAt(0);
    	image.setImageResource(mBilder[position]);
    	TextView text = (TextView) lay.getChildAt(1);
    	text.setText(mText[position]);
        
        
        return lay;
    }
     
    private String[] mText = {
            "R.drawable.sample_2",
            "R.drawable.sample_3",
            "R.drawable.sample_4",
            "R.drawable.sample_5",
            "R.drawable.sample_6",
            "R.drawable.sample_7"};
    
    private Integer[] mBilder = {
    		R.drawable.mensa,
    		R.drawable.mensa,
    		R.drawable.mensa,
    		R.drawable.mensa,
    		R.drawable.mensa,
    		R.drawable.mensa
    		
    };

    // references to our images
    
}
